<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<script type="text/javascript">
  //<![CDATA[
   //debe usarse los \\:  en lugar de : en los selectores de JQuery
   $( document ).ready(function() {	  
	 console.log('Listo');
	});        
   
   function processLogin(xhr, status, args) {
		setTimeout(function() {
			window.location = args.view;
		}, 500);
	}
//]]>
</script>
</h:head>
<h:body>



	<h1>
		<h:outputLabel value="Control robot" />
	</h1>
	<h:form id="form_login">
		
		<div class="clearfix common-panel text-align-center">

			<div class="clearfix width-400px" style="margin-left: 405px;">
				<div class="ui-form-row clearfix text-align-left">
					<h:outputLabel for="username"
						value="#{i18n['lbl.login.user_name']}" />
				</div>
				<div class="ui-form-row clearfix text-align-left">
					<p:inputText value="#{loginController.userName}" id="username"
						required="true" label="username" />
				</div>

				<div class="ui-form-row clearfix text-align-left">
					<h:outputLabel for="password" value="#{i18n['lbl.login.password']}" />
				</div>
				<div class="ui-form-row clearfix text-align-left">
					<p:password value="#{loginController.password}" id="password"
						required="true" label="password" />
				</div>
			</div>
			<div class="ui-form-row clearfix text-align-center">
				<p:commandButton id="loginButton" value="#{i18n['lbl.login.login']}"
					actionListener="#{loginController.login}" 
					oncomplete="processLogin(xhr, status, args)" />
			</div>
		</div>



	</h:form>

</h:body>

</html>